import 'package:flutter/material.dart';
import 'package:flutter_changdian_football/pages/splash/splash_controller.dart';
import 'package:flutter_changdian_football/widget/screenutil/custom_screenutil.dart';
import 'package:get/get_state_manager/get_state_manager.dart';

// 闪屏页
class SplashPage extends StatelessWidget {
  const SplashPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: GetBuilder<SplashController>(
        init: SplashController(),
        builder: (splashController) {
          return Stack(
            children: [
              Image.asset(
                'assets/images/image_splash.png',
                width: double.infinity,
                height: double.infinity,
                fit: BoxFit.fill,
              ),

              Positioned(
                top: 50.w,
                right: 20.w,
                child: GestureDetector(
                  behavior: HitTestBehavior.translucent,
                  onTap: () {
                    splashController.jumpOver();
                  },
                  child: Container(
                    decoration: BoxDecoration(
                      color: const Color(0xff333333).withOpacity(0.5),
                      borderRadius: BorderRadius.circular(30.r)
                    ),
                    padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 6.w),
                    child: Text('跳过 0${splashController.time}', style: TextStyle(fontSize: 14.sp, color: Colors.white),),
                  ),
                )
              )
            ],
          );
        }
      ),
    );
  }
}